import ClientLibrary.Board;
import ClientLibrary.Logger;
import ClientLibrary.Network.NetLayer;
import ClientLibrary.UI.MainForm;
import ClientLibrary.UI.MenuForm;
import ClientLibrary.UI.RegistrationForm;

import java.util.Dictionary;

public class Program
{
    private static Logger log = null;
    private static NetLayer layer = null;
    
    public static void main(String[] args)
    {
        log = new Logger(System.out);
        try
        {
            layer = new NetLayer(log, "5.200.14.36", 4444);
            Board.getBoard().setLayer(layer);
        }
        catch (Exception error)
        {
            System.out.print("Error in new new layout constructor\n");
            System.out.print(error.getMessage());
        }

        RegistrationForm regForm = new RegistrationForm();
        regForm.setNetLayer(layer);
        regForm.paintFrame();

        Receiver r = new Receiver(layer);
        Thread t = new Thread(r);
        t.start();

        try
        {
            Thread.currentThread().join();
        }
        catch (InterruptedException e)
        {
            System.out.print("Error while joining");
        }
    }
}
